package com.task.manage.system.service.impl;

import java.util.List;

import com.task.manage.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.task.manage.system.mapper.TaskReveiveRecordMapper;
import com.task.manage.system.domain.TaskReveiveRecord;
import com.task.manage.system.service.ITaskReveiveRecordService;
import com.task.manage.common.core.text.Convert;

/**
 * 任务领取记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-11
 */
@Service
public class TaskReveiveRecordServiceImpl implements ITaskReveiveRecordService {
    @Autowired
    private TaskReveiveRecordMapper taskReveiveRecordMapper;

    /**
     * 查询任务领取记录
     *
     * @param id 任务领取记录主键
     * @return 任务领取记录
     */
    @Override
    public TaskReveiveRecord selectTaskReveiveRecordById(Long id) {
        return taskReveiveRecordMapper.selectTaskReveiveRecordById(id);
    }

    /**
     * 查询任务领取记录列表
     *
     * @param taskReveiveRecord 任务领取记录
     * @return 任务领取记录
     */
    @Override
    public List<TaskReveiveRecord> selectTaskReveiveRecordList(TaskReveiveRecord taskReveiveRecord) {
        return taskReveiveRecordMapper.selectTaskReveiveRecordList(taskReveiveRecord);
    }

    /**
     * 新增任务领取记录
     *
     * @param taskReveiveRecord 任务领取记录
     * @return 结果
     */
    @Override
    public Long insertTaskReveiveRecord(TaskReveiveRecord taskReveiveRecord) {
        taskReveiveRecord.setCreateTime(DateUtils.getNowDate());
        return taskReveiveRecordMapper.insertTaskReveiveRecord(taskReveiveRecord);
    }

    /**
     * 修改任务领取记录
     *
     * @param taskReveiveRecord 任务领取记录
     * @return 结果
     */
    @Override
    public int updateTaskReveiveRecord(TaskReveiveRecord taskReveiveRecord) {
        taskReveiveRecord.setUpdateTime(DateUtils.getNowDate());
        return taskReveiveRecordMapper.updateTaskReveiveRecord(taskReveiveRecord);
    }

    /**
     * 批量删除任务领取记录
     *
     * @param ids 需要删除的任务领取记录主键
     * @return 结果
     */
    @Override
    public int deleteTaskReveiveRecordByIds(String ids) {
        return taskReveiveRecordMapper.deleteTaskReveiveRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除任务领取记录信息
     *
     * @param id 任务领取记录主键
     * @return 结果
     */
    @Override
    public int deleteTaskReveiveRecordById(Long id) {
        return taskReveiveRecordMapper.deleteTaskReveiveRecordById(id);
    }

    @Override
    public Long selectMaxId() {

        return taskReveiveRecordMapper.selectMaxId();
    }
}
